use risk_contagion_engine::{Graph, NetworkAnalyzer, Company, Relationship};

#[test]
fn test_add_company() {
    let mut graph = Graph::new();
    let company = Company {
        id: "C001".to_string(),
        name: "Test Company".to_string(),
        risk_score: 0.5,
        industry: "Tech".to_string(),
        size: 100,
    };

    let node_idx = graph.add_company(company);
    assert!(node_idx.index() > 0); // 确保节点被添加
}

#[test]
fn test_add_relationship() {
    let mut graph = Graph::new();

    // 添加两个公司
    let company1 = Company {
        id: "C001".to_string(),
        name: "Company 1".to_string(),
        risk_score: 0.5,
        industry: "Tech".to_string(),
        size: 100,
    };

    let company2 = Company {
        id: "C002".to_string(),
        name: "Company 2".to_string(),
        risk_score: 0.3,
        industry: "Manufacturing".to_string(),
        size: 200,
    };

    graph.add_company(company1);
    graph.add_company(company2);

    // 添加关系
    let relationship = Relationship {
        strength: 0.7,
        relationship_type: "supplier".to_string(),
    };

    let result = graph.add_relationship("C001", "C002", relationship);
    assert!(result.is_ok());
}

// 更多网络功能测试...
